home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-09-04 | 50.2 KB | 1,874 lines |
- Newsgroups: comp.sources.misc
- From: Warren Tucker <wht@n4hgf.GA.US>
- Subject: v22i091: ecu - ECU async comm package rev 3.10, Patch05b/5
- Message-ID: <1991Sep4.160147.28312@sparky.IMD.Sterling.COM>
- X-Md4-Signature: c1f00d15b9b5d0817498ffbe96c26550
- Date: Wed, 4 Sep 1991 16:01:47 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: Warren Tucker <wht@n4hgf.GA.US>
- Posting-number: Volume 22, Issue 91
- Archive-name: ecu/patch05b
- Environment: SCO, XENIX, ISC, SUNOS4.1, SYSVR4
- Patch-To: ecu: Volume 21, Issue 53-89
-
- #!/bin/sh
- # this is p5.02 (part 2 of ecu/patch05)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file PATCH5.01 continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 2; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping PATCH5.01'
- else
- echo 'x - continuing file PATCH5.01'
- sed 's/^X//' << 'SHAR_EOF' >> 'PATCH5.01' &&
- X- #if defined(M_SYSV)
- X #include <memory.h>
- X- #endif
- X #include <sys/stat.h>
- X #include <fcntl.h>
- X #if !defined(OMIT_TERMIO_REFERENCES)
- X #include <termio.h>
- X #endif
- X
- X #if defined(M_UNIX)
- X #undef M_XENIX /* we don't want this defined in UNIX world */
- X--- 34,64 ----
- X #include <errno.h>
- X #include <sys/timeb.h>
- X #include <string.h>
- X #include <memory.h>
- X #include <sys/stat.h>
- X #include <fcntl.h>
- X+
- X #if !defined(OMIT_TERMIO_REFERENCES)
- X+ #if defined(sun)
- X #include <termio.h>
- X+ #define termio termios
- X+ #undef TCGETA
- X+ #undef TCSETA
- X+ #undef TCSETAW
- X+ #define TCGETA TCGETS
- X+ #define TCSETA TCSETS
- X+ #define TCSETAW TCSETSW
- X+ #else
- X+ #include <termio.h>
- X+ #endif /* sun */
- X+ #endif /* OMIT_TERMIO_REFERENCES */
- X+
- X+ #if defined(sun) && defined(FASI)
- X+ #undef FASI
- X #endif
- X+ #if defined(sun) && defined(MORSE)
- X+ #undef MORSE
- X+ #endif
- X
- X #if defined(M_UNIX)
- X #undef M_XENIX /* we don't want this defined in UNIX world */
- X***************
- X*** 174,182 ****
- X--- 196,220 ----
- X extern int rcvr_pid;
- X extern int xmtr_pid;
- X
- X+ /*
- X+ * both of the following are set by xmtr_SIGINT_handler()
- X+ * 'sigint' reset by 1st detector/processor
- X+ * 'proc_interrupt' reset/handled by procedure monitor
- X+ * (execute_esd and execute_proc)
- X+ */
- X+ extern int sigint;
- X+ /* extern int proc_interrupt; <------ force using modules to declare it */
- X+
- X+ /*
- X+ * 'hz' is getenv("HZ"); that not found, the value from sys/param.h
- X+ * 'hzmsec' is ceiling(clock period) in milliseconds
- X+ */
- X extern int hz; /* HZ from environ or sys/param.h */
- X extern ulong hzmsec; /* clock period in msec rounded up */
- X
- X+ /*
- X+ * tty (comm line) variables that are not in shared memory
- X+ */
- X #if defined(DECLARE_LINEVARS_PUBLIC)
- X char LLCKname[128]; /* lock file name */
- X #if !defined(OMIT_TERMIO_REFERENCES)
- X***************
- X*** 244,249 ****
- X--- 282,289 ----
- X extern ulong colors_alert;
- X extern ulong colors_error;
- X extern ulong colors_notify;
- X+
- X+ extern char *eculibdir;
- X
- X /*
- X * param to lgets_timeout in eculine.c
- X*** /export/home/wht/src/ecu314/ecuDCE.c Wed Sep 4 00:25:04 1991
- X--- ecuDCE.c Tue Sep 3 19:56:31 1991
- X***************
- X*** 23,29 ****
- X
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */
- X /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
- X /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
- X /*:06-29-1991-15:42-wht@n4hgf-if WHT and xterm, play with title bar */
- X--- 23,29 ----
- X
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
- X /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
- X /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
- X /*:06-29-1991-15:42-wht@n4hgf-if WHT and xterm, play with title bar */
- X***************
- X*** 44,57 ****
- X #include "relop.h"
- X
- X long time();
- X- long Nap();
- X
- X char *make_char_graphic();
- X void DCE_hangup();
- X
- X- extern int rcvr_pid;
- X- extern int sigint;
- X- extern int proc_interrupt;
- X extern int proctrace;
- X extern ulong colors_current;
- X extern char kbdintr;
- X--- 44,53 ----
- X***************
- X*** 311,317 ****
- X static char s32[32];
- X LRWT lr;
- X
- X! sigint = 0;
- X s32[0] = 0;
- X lr.to1 = msec_to_wait;
- X lr.to2 = 200L;
- X--- 307,314 ----
- X static char s32[32];
- X LRWT lr;
- X
- X! if(sigint)
- X! return("!Interrupted");
- X s32[0] = 0;
- X lr.to1 = msec_to_wait;
- X lr.to2 = 200L;
- X***************
- X*** 322,329 ****
- X lr.echo_flag = 0;
- X lgets_timeout(&lr);
- X
- X! /* reset any interrupt indication since we look at string */
- X! sigint = 0;
- X
- X return(lr.buffer);
- X } /* end of DCE_get_result */
- X--- 319,326 ----
- X lr.echo_flag = 0;
- X lgets_timeout(&lr);
- X
- X! if(sigint)
- X! return("!Interrupted");
- X
- X return(lr.buffer);
- X } /* end of DCE_get_result */
- X***************
- X*** 342,350 ****
- X if(shm->Lmodem_already_init)
- X return(0);
- X
- X- sigint = 0;
- X DCE_read_modem_init();
- X
- X lputs_paced(0,"\b\b\b\b\b\b\b\b\b\r");
- X (void)Nap(200L);
- X lflush(0);
- X--- 339,347 ----
- X if(shm->Lmodem_already_init)
- X return(0);
- X
- X DCE_read_modem_init();
- X
- X+ ttymode(2);
- X lputs_paced(0,"\b\b\b\b\b\b\b\b\b\r");
- X (void)Nap(200L);
- X lflush(0);
- X***************
- X*** 459,465 ****
- X pputc(NL);
- X lputc_paced(20,CRET);
- X itmp = 0;
- X! if(check_queued_sigint())
- X return(-1);
- X while(itmp != CRET)
- X {
- X--- 456,462 ----
- X pputc(NL);
- X lputc_paced(20,CRET);
- X itmp = 0;
- X! if(sigint || check_queued_sigint())
- X return(-1);
- X while(itmp != CRET)
- X {
- X***************
- X*** 468,474 ****
- X pputs("missed expected carriage return\n");
- X return(-1);
- X }
- X! if(check_queued_sigint())
- X return(-1);
- X }
- X return(0);
- X--- 465,471 ----
- X pputs("missed expected carriage return\n");
- X return(-1);
- X }
- X! if(sigint || check_queued_sigint())
- X return(-1);
- X }
- X return(0);
- X***************
- X*** 607,613 ****
- X }
- X #endif /* WHT */
- X
- X! if(check_queued_sigint())
- X goto SEND_CMD_ERROR;
- X
- X if(DCE_send_cmd(s128))
- X--- 604,610 ----
- X }
- X #endif /* WHT */
- X
- X! if(sigint || check_queued_sigint())
- X goto SEND_CMD_ERROR;
- X
- X if(DCE_send_cmd(s128))
- X***************
- X*** 620,634 ****
- X strcpy(s64,DCE_get_result(s7 * 2 * 1000L));
- X result = s64;
- X
- X! if(!strcmp(result,interrupted_string))
- X {
- X setcolor(colors_error);
- X pprintf("%s\n",result);
- X- lputc(0); /* make modem go on hook */
- X- (void)Nap(40L);
- X- lputc(0);
- X sigint = 0;
- X! (void)DCE_get_result(2000L); /* wait for NO CARRIER */
- X erc = eCONINT;
- X iv[0] = 2;
- X DCE_report_iv_set(0);
- X--- 617,630 ----
- X strcpy(s64,DCE_get_result(s7 * 2 * 1000L));
- X result = s64;
- X
- X! if(sigint || !strcmp(result,interrupted_string))
- X {
- X setcolor(colors_error);
- X pprintf("%s\n",result);
- X sigint = 0;
- X! lputc(0); /* send char in case DTR ignored */
- X! ltoggle_dtr(); /* force on hook */
- X! (void)DCE_get_result(2000L); /* wait for any result code */
- X erc = eCONINT;
- X iv[0] = 2;
- X DCE_report_iv_set(0);
- X***************
- X*** 648,657 ****
- X }
- X }
- X CONNECTED:
- X! #ifdef WHT /* if xterm, put connection in title bar */
- X sprintf(s128,"connected to %s",shm->Llogical);
- X xterm_title(s128,1);
- X- bell_notify(XBELL_C);
- X #endif
- X setcolor(colors_success);
- X pprintf("%s\n",result);
- X--- 644,653 ----
- X }
- X }
- X CONNECTED:
- X! #if defined(WHT) || defined(XTERM_FRIEND)
- X! /* if xterm, put connection in title bar */
- X sprintf(s128,"connected to %s",shm->Llogical);
- X xterm_title(s128,1);
- X #endif
- X setcolor(colors_success);
- X pprintf("%s\n",result);
- X***************
- X*** 661,669 ****
- X ecu_log_event(getpid(),s128);
- X if(isalpha(shm->Llogical[0]))
- X {
- X! if(keyset_read(shm->Llogical))
- X! keyset_init();
- X! else
- X pprintf("[autoloaded fkeys for %s]\n",shm->Llogical);
- X }
- X shmx_connect();
- X--- 657,663 ----
- X ecu_log_event(getpid(),s128);
- X if(isalpha(shm->Llogical[0]))
- X {
- X! if(!keyset_read(shm->Llogical))
- X pprintf("[autoloaded fkeys for %s]\n",shm->Llogical);
- X }
- X shmx_connect();
- X***************
- X*** 688,695 ****
- X }
- X
- X SEND_CMD_ERROR: ;
- X! if(sigint || proc_interrupt)
- X {
- X result = interrupted_string;
- X iv[0] = 2;
- X DCE_report_iv_set(0);
- X--- 682,690 ----
- X }
- X
- X SEND_CMD_ERROR: ;
- X! if(sigint)
- X {
- X+ sigint = 0;
- X result = interrupted_string;
- X iv[0] = 2;
- X DCE_report_iv_set(0);
- X***************
- X*** 815,822 ****
- X ulong colors_at_entry = colors_current;
- X pargv[0] = shm->Llogical;
- X pargv[1] = "!REDIAL;";
- X- ttymode(2);
- X sigint = 0;
- X erc = do_proc(2,pargv);
- X proc_file_reset();
- X ttymode(1);
- X--- 810,817 ----
- X ulong colors_at_entry = colors_current;
- X pargv[0] = shm->Llogical;
- X pargv[1] = "!REDIAL;";
- X sigint = 0;
- X+ ttymode(2);
- X erc = do_proc(2,pargv);
- X proc_file_reset();
- X ttymode(1);
- X***************
- X*** 898,904 ****
- X shm->Llogical,shm->Ltelno,connect_secs,
- X get_elapsed_time(connect_secs));
- X ecu_log_event(getpid(),s128);
- X! #ifdef WHT /* if xterm, put connection in title bar */
- X xterm_title("disconnected",1);
- X #endif
- X /*
- X--- 893,899 ----
- X shm->Llogical,shm->Ltelno,connect_secs,
- X get_elapsed_time(connect_secs));
- X ecu_log_event(getpid(),s128);
- X! #if defined(WHT) || defined(XTERM_FRIEND)
- X xterm_title("disconnected",1);
- X #endif
- X /*
- X*** /export/home/wht/src/ecu314/ecuLCK.c Wed Sep 4 00:24:49 1991
- X--- ecuLCK.c Sun Sep 1 17:10:35 1991
- X***************
- X*** 170,176 ****
- X if(itmp = is_active_lock(lock_file_name))
- X return(itmp);
- X
- X! #if (defined(M_XENIX) || defined(M_UNIX)) && defined(SCO_TTY_NAMING)
- X if(isalpha(lock_file_name[itmp = strlen(lock_file_name) - 1]))
- X {
- X lock_file_name[itmp] ^= 0x20; /* lower->upper, upper->lower */
- X--- 170,176 ----
- X if(itmp = is_active_lock(lock_file_name))
- X return(itmp);
- X
- X! #if defined(M_SYSV) /* && defined(SCO_TTY_NAMING) */
- X if(isalpha(lock_file_name[itmp = strlen(lock_file_name) - 1]))
- X {
- X lock_file_name[itmp] ^= 0x20; /* lower->upper, upper->lower */
- X*** /export/home/wht/src/ecu314/ecucmd.h Wed Sep 4 00:24:50 1991
- X--- ecucmd.h Sun Sep 1 19:28:17 1991
- X***************
- X*** 3,8 ****
- X--- 3,10 ----
- X wht@n4hgf.Mt-Park.GA.US
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X+ /*:09-01-1991-18:12-wht@n4hgf2-add setline */
- X+ /*:09-01-1991-18:11-wht@n4hgf2-add setline */
- X /*:08-17-1991-16:41-wht@n4hgf-add kbdtest */
- X /*:07-29-1991-17:57-wht@n4hgf-add memstat */
- X /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
- X***************
- X*** 171,176 ****
- X--- 173,179 ----
- X int pcmd_scrdump() Z
- X int pcmd_send() Z
- X int pcmd_set() Z
- X+ int pcmd_setline() Z
- X int pcmd_sk() Z
- X int pcmd_ss() Z
- X int pcmd_sx() Z
- X***************
- X*** 272,278 ****
- X { "log", 3,CTlog, "session logging control", 0, ccG },
- X { "logevent",0,0, "", pcmd_logevent,0},
- X { "lookfor",0,0, "", pcmd_lookfor,0 },
- X! #if defined(WHT) && defined(MALLOC_3X)
- X { "memstat",3,CTmemstat,"", 0, 0 },
- X #endif
- X /* { "mkdir", 3,CTmkdir, "mkdir <dirname>", pcmd_mkdir, ccG}, */
- X--- 275,281 ----
- X { "log", 3,CTlog, "session logging control", 0, ccG },
- X { "logevent",0,0, "", pcmd_logevent,0},
- X { "lookfor",0,0, "", pcmd_lookfor,0 },
- X! #if defined(MALLOC_3X)
- X { "memstat",3,CTmemstat,"", 0, 0 },
- X #endif
- X /* { "mkdir", 3,CTmkdir, "mkdir <dirname>", pcmd_mkdir, ccG}, */
- X***************
- X*** 310,315 ****
- X--- 313,319 ----
- X { "sdname", 3,CTsdname, "select screen dump name", 0, ccC },
- X { "send", 0,0, "", pcmd_send, 0 },
- X { "set", 0,0, "", pcmd_set, 0 },
- X+ { "setline",0,0, "", pcmd_setline,0 },
- X { "sgr", 2,CTsgr, "send command/get response", 0, ccC },
- X { "sk", 2,CTsk, "send via C-Kermit", pcmd_sk, ccT },
- X { "ss", 2,CTss, "send via SEAlink", pcmd_ss, ccT },
- X*** /export/home/wht/src/ecu314/ecufinsert.c Wed Sep 4 00:24:40 1991
- X--- ecufinsert.c Tue Sep 3 18:58:23 1991
- X***************
- X*** 21,27 ****
- X #include "ecukey.h"
- X #include "ecutty.h"
- X
- X- extern int sigint;
- X extern char kbdintr; /* current input INTR */
- X extern ulong colors_current;
- X extern ulong colors_alert;
- X--- 21,26 ----
- X***************
- X*** 111,116 ****
- X--- 110,117 ----
- X #endif
- X char *make_char_graphic();
- X
- X+ sigint = 0;
- X+
- X if(narg > 1)
- X {
- X strncpy(s256,arg[1],sizeof(s256));
- X***************
- X*** 193,199 ****
- X lxon_xoff(IXON); /* set it for us */
- X #endif
- X
- X- sigint = 0; /* reset SIGINT flag */
- X while(fgets(file_string,sizeof(file_string),fp))
- X {
- X int xmit_len = strlen(file_string);
- X--- 194,199 ----
- X***************
- X*** 304,309 ****
- X--- 304,310 ----
- X
- X if(sigint)
- X {
- X+ sigint = 0;
- X setcolor(colors_error);
- X ff(se,"--> Interrupted\r\n");
- X setcolor(colors_at_entry);
- X*** /export/home/wht/src/ecu314/ecufkey.c Wed Sep 4 00:24:51 1991
- X--- ecufkey.c Mon Sep 2 22:56:14 1991
- X***************
- X*** 14,42 ****
- X keyset_read(name)
- X xf_to_KDEt(xf)
- X
- X- I had a problem with gcc 1.39 when I added -fcall-used-... in
- X- that the assembler code generated for keyset_display() had a
- X- syntax error When it blows up, I did:
- X-
- X- make
- X- ecufkey.c:
- X- aline: syntax error in line blah
- X- make -n ecufkey.o > tmp
- X- edit tmp to add -S after -c
- X- source tmp -or- . tmp
- X- as ecufkey.s
- X- aline: syntax error in line blah
- X- edit ecufkey.s, find line blah,
- X- change movl operand from '.Lxxx' to '$.Lxxx'
- X- as ecufkey.s
- X- make --- resume normal making
- X-
- X- so it must be a little boog. There's a workaround in place ( using
- X- a function in ecuutil.c, a separate compilation unit).
- X-
- X- GCC 1.40 fixed the bug, so #ifdef GCC140, don't use the kludge.
- X ------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X /*:08-16-1991-00:11-wht@n4hgf-keyset_init loads default keyset if found */
- X /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
- X /*:07-12-1991-13:57-wht@n4hgf-GCC140 fix update */
- X--- 14,23 ----
- X keyset_read(name)
- X xf_to_KDEt(xf)
- X
- X ------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X+ /*:09-01-1991-05:16-wht@n4hgf2-allow comments and whitespace after names */
- X+ /*:08-31-1991-13:21-wht@n4hgf2-look for keys file in ECULIBDIR */
- X /*:08-16-1991-00:11-wht@n4hgf-keyset_init loads default keyset if found */
- X /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
- X /*:07-12-1991-13:57-wht@n4hgf-GCC140 fix update */
- X***************
- X*** 123,134 ****
- X tkde->str[0] = 0x7F; /* this key is intercepted by kbd read routine */
- X tkde->count = 0;
- X
- X- keyset_read("default");
- X-
- X } /* end of keyset_init */
- X
- X /*+-------------------------------------------------------------------------
- X! kde_fgets(buf,bufsize,fp)
- X --------------------------------------------------------------------------*/
- X int
- X kde_fgets(buf,bufsize,fp)
- X--- 104,120 ----
- X tkde->str[0] = 0x7F; /* this key is intercepted by kbd read routine */
- X tkde->count = 0;
- X
- X } /* end of keyset_init */
- X
- X /*+-------------------------------------------------------------------------
- X! kde_fgets(buf,bufsize,fp) - read and evaluate key file line
- X!
- X! Returns:
- X! KDEt_COMMENT comment or blank line (null, all blank or "#"
- X! as non-blank)
- X! KDEt_NAME "name" (non "#\t " in column 1)
- X! KDEt_ENTRY "entry" ("\t " in column 1)
- X! KDEt_EOF end of file
- X --------------------------------------------------------------------------*/
- X int
- X kde_fgets(buf,bufsize,fp)
- X***************
- X*** 146,152 ****
- X
- X if(!(itmp = strlen(buf)))
- X return(KDEt_COMMENT);
- X! if(buf[itmp - 1] == '\n')
- X {
- X buf[itmp - 1] = 0;
- X itmp--;
- X--- 132,138 ----
- X
- X if(!(itmp = strlen(buf)))
- X return(KDEt_COMMENT);
- X! if(buf[itmp - 1] == NL)
- X {
- X buf[itmp - 1] = 0;
- X itmp--;
- X***************
- X*** 285,291 ****
- X /*+-------------------------------------------------------------------------
- X keyset_define_key(bufptr)
- X
- X! return 0 if no error, 1 if done, -1 if error
- X --------------------------------------------------------------------------*/
- X int
- X keyset_define_key(bufptr)
- X--- 271,277 ----
- X /*+-------------------------------------------------------------------------
- X keyset_define_key(bufptr)
- X
- X! return 0 if no error, -1 if error
- X --------------------------------------------------------------------------*/
- X int
- X keyset_define_key(bufptr)
- X***************
- X*** 298,318 ****
- X char token_separator[8];
- X char *token;
- X char *syntax = "syntax error in key definition: %s\n";
- X- char *str_token();
- X
- X! if(itmp = strlen(bufptr)) /* itmp = len; if > 0 ... */
- X! bufptr[--itmp] = 0; /* ... strip trailing NL */
- X if(!itmp)
- X return(0);
- X
- X! if(bufptr[0] == '#') /* comment? */
- X return(0);
- X- if((*bufptr != 0x20) && (*bufptr != TAB)) /* if no leading space */
- X- return(1);
- X- if(*bufptr == 0) /* if line all blank, break */
- X- return(1);
- X
- X! while((*bufptr == 0x20) || (*bufptr == TAB)) /* strip lding sp/tab */
- X bufptr++;
- X
- X token_number = 0;
- X--- 284,299 ----
- X char token_separator[8];
- X char *token;
- X char *syntax = "syntax error in key definition: %s\n";
- X
- X! if((itmp = strlen(bufptr)) && (bufptr[itmp - 1] == NL))
- X! bufptr[--itmp] = 0; /* strip trailing NL */
- X if(!itmp)
- X return(0);
- X
- X! if((*bufptr != SPACE) && (*bufptr != TAB)) /* if no leading space */
- X return(0);
- X
- X! while((*bufptr == SPACE) || (*bufptr == TAB)) /* strip lding sp/tab */
- X bufptr++;
- X
- X token_number = 0;
- X***************
- X*** 394,452 ****
- X char *name;
- X {
- X register itmp = 0;
- X! register char *cptr;
- X! static char ecukeys_name[128];
- X! char readkde_buf[128];
- X FILE *fp_keys;
- X
- X! if(!ecukeys_name[0])
- X {
- X! get_home_dir(ecukeys_name);
- X! strcat(ecukeys_name,"/.ecu/keys");
- X }
- X
- X- if((fp_keys = fopen(ecukeys_name,"r")) == NULL)
- X- return(-1);
- X-
- X /* find keyset name */
- X! while(fgets(readkde_buf,sizeof(readkde_buf),fp_keys) != NULL)
- X {
- X! if(readkde_buf[0] == '#') /* comment? */
- X! continue;
- X! if(itmp = strlen(readkde_buf)) /* itmp = len; if > 0 ... */
- X! readkde_buf[--itmp] = 0; /* ... strip trailing NL */
- X! if(!itmp)
- X! continue;
- X! if(strcmp(readkde_buf,name) == 0)
- X {
- X! itmp = 1; /* indicate success */
- X break;
- X }
- X- itmp = 0; /* if loop terminates w/o find, failure */
- X }
- X! if(!itmp)
- X {
- X! fclose(fp_keys);
- X return(-2);
- X }
- X
- X- keyset_init(); /* clear any previous key defns */
- X- strncpy(keyset_name,name,sizeof(keyset_name));
- X- keyset_name[sizeof(keyset_name) - 1] = 0;
- X-
- X /*
- X * read past any other keyset names matching this set
- X * process 1st line of definition when found
- X */
- X! while(fgets(readkde_buf,sizeof(readkde_buf),fp_keys) != NULL)
- X {
- X! cptr = readkde_buf; /* first call to str_token, -> buff */
- X! if((*cptr == 0x20) || (*cptr == TAB)) /* if leading space */
- X {
- X! if((itmp = keyset_define_key(readkde_buf)) < 0)
- X {
- X fclose(fp_keys);
- X! keyset_name[0] = 0;
- X return(-3);
- X }
- X break;
- X--- 375,426 ----
- X char *name;
- X {
- X register itmp = 0;
- X! int KDEt;
- X! char ecukeys_name[128];
- X! char s128[128];
- X FILE *fp_keys;
- X
- X! get_home_dir(ecukeys_name);
- X! strcat(ecukeys_name,"/.ecu/keys"); /* somebody will core dump here 1 day */
- X!
- X! if(!(fp_keys = fopen(ecukeys_name,"r")))
- X {
- X! strcpy(ecukeys_name,eculibdir);
- X! strcat(ecukeys_name,"/keys");
- X! if(!(fp_keys = fopen(ecukeys_name,"r")))
- X! return(-1);
- X }
- X
- X /* find keyset name */
- X! itmp = 0;
- X! while((KDEt = kde_fgets(s128,sizeof(s128),fp_keys)) != KDEt_EOF)
- X {
- X! if((KDEt == KDEt_NAME) && !strcmp(s128,name))
- X {
- X! itmp = 1; /* success */
- X break;
- X }
- X }
- X! if(!itmp) /* find match? */
- X {
- X! fclose(fp_keys); /* nope */
- X return(-2);
- X }
- X
- X /*
- X * read past any other keyset names matching this set
- X * process 1st line of definition when found
- X */
- X! while((KDEt = kde_fgets(s128,sizeof(s128),fp_keys)) != KDEt_EOF)
- X {
- X! if((KDEt == KDEt_NAME) || (KDEt == KDEt_COMMENT))
- X! continue;
- X! else if(KDEt == KDEt_ENTRY)
- X {
- X! if(keyset_define_key(s128) < 0)
- X {
- X fclose(fp_keys);
- X! keyset_init();
- X return(-3);
- X }
- X break;
- X***************
- X*** 456,473 ****
- X /*
- X * read rest of definition
- X */
- X! while(fgets(readkde_buf,sizeof(readkde_buf),fp_keys) != NULL)
- X {
- X! if((itmp = keyset_define_key(readkde_buf)) < 0)
- X {
- X! fclose(fp_keys);
- X! keyset_name[0] = 0;
- X! return(-3);
- X }
- X- else if(itmp)
- X- break;
- X }
- X
- X fclose(fp_keys);
- X return(0);
- X } /* end of keyset_read */
- X--- 430,457 ----
- X /*
- X * read rest of definition
- X */
- X! while((KDEt = kde_fgets(s128,sizeof(s128),fp_keys)) != KDEt_EOF)
- X {
- X! switch(KDEt)
- X {
- X! case KDEt_COMMENT:
- X! continue;
- X! case KDEt_ENTRY:
- X! if(keyset_define_key(s128) < 0)
- X! {
- X! fclose(fp_keys);
- X! keyset_init();
- X! return(-3);
- X! }
- X! break;
- X! default:
- X! goto DONE;
- X }
- X }
- X
- X+ DONE:
- X+ strncpy(keyset_name,name,sizeof(keyset_name));
- X+ keyset_name[sizeof(keyset_name) - 1] = 0;
- X fclose(fp_keys);
- X return(0);
- X } /* end of keyset_read */
- X*** /export/home/wht/src/ecu314/ecufork.c Wed Sep 4 00:24:40 1991
- X--- ecufork.c Sun Sep 1 03:14:04 1991
- X***************
- X*** 12,17 ****
- X--- 12,18 ----
- X
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X+ /*:08-29-1991-01:56-wht@n4hgf2-use max esd size instead of 5120 */
- X /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
- X /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
- X /*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */
- X***************
- X*** 18,23 ****
- X--- 19,25 ----
- X /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
- X
- X #include "ecu.h"
- X+ #include "esd.h"
- X #include "ecufork.h"
- X
- X extern int rcvr_pid;
- X***************
- X*** 234,240 ****
- X--- 236,250 ----
- X char *cmdstr;
- X {
- X char *cmdpath;
- X+ #ifdef M_I286
- X #define MAX_EXEC_ARG 512
- X+ #else
- X+ #if defined(M_UNIX) || defined(ISC)
- X+ #define MAX_EXEC_ARG 1024
- X+ #else
- X+ #define MAX_EXEC_ARG 2048
- X+ #endif /* M_UNIX || ISC */
- X+ #endif /* M_I286 */
- X char *cmdargv[MAX_EXEC_ARG];
- X int itmp;
- X int execpid;
- X***************
- X*** 437,443 ****
- X return(-1);
- X }
- X
- X! if(!(*expcmd = malloc(expcmd_size = 5120)))
- X {
- X close(stdout_pipe[P_READ]);
- X close(stderr_pipe[P_READ]);
- X--- 447,453 ----
- X return(-1);
- X }
- X
- X! if(!(*expcmd = malloc(expcmd_size = ESD_MAXSIZE)))
- X {
- X close(stdout_pipe[P_READ]);
- X close(stderr_pipe[P_READ]);
- X*** /export/home/wht/src/ecu314/ecuicmd.c Wed Sep 4 00:24:51 1991
- X--- ecuicmd.c Tue Sep 3 19:01:39 1991
- X***************
- X*** 46,52 ****
- X extern char hello_str[];
- X extern char keyset_name[];
- X extern char rcvr_log_file[]; /* if rcvr_log!= 0,log filename */
- X- extern int sigint;
- X extern int current_ttymode;
- X extern long tty_escape_timeout; /* timeout on waiting for char after ESC */
- X extern int tcap_COLS;
- X--- 46,51 ----
- X***************
- X*** 63,69 ****
- X extern int rcvr_log; /* rcvr log active if != 0 */
- X extern int rcvr_log_append; /* if true, append, else scratch */
- X extern int rcvr_log_raw; /* if true, log all, else filter ctl chrs */
- X- extern int rcvr_pid;
- X extern ulong colors_current;
- X extern FILE *plog_fp;
- X extern ESD *plog_name;
- X--- 62,67 ----
- X***************
- X*** 585,591 ****
- X case 0: keyset_display(); break;
- X case -1: ff(se," cannot find ~/.ecu/keys\r\n"); break;
- X case -2: ff(se," not found in ~/.ecu/keys\r\n"); break;
- X! case -3: ff(se," syntax error\r\n"); break;
- X }
- X }
- X break;
- X--- 583,593 ----
- X case 0: keyset_display(); break;
- X case -1: ff(se," cannot find ~/.ecu/keys\r\n"); break;
- X case -2: ff(se," not found in ~/.ecu/keys\r\n"); break;
- X! case -3: ff(se," syntax error ... default restored\r\n");
- X! default:
- X! keyset_init();
- X! keyset_read("default");
- X! break;
- X }
- X }
- X break;
- X*** /export/home/wht/src/ecu314/ecuicmhist.c Wed Sep 4 00:25:05 1991
- X--- ecuicmhist.c Sun Sep 1 19:30:41 1991
- X***************
- X*** 8,14 ****
- X
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */
- X /*:08-11-1991-14:58-wht@n4hgf-new ttygets botched command history handler */
- X /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
- X /*:07-14-1991-18:18-wht@n4hgf-new ttygets functions */
- X--- 8,14 ----
- X
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
- X /*:08-11-1991-14:58-wht@n4hgf-new ttygets botched command history handler */
- X /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
- X /*:07-14-1991-18:18-wht@n4hgf-new ttygets functions */
- X***************
- X*** 27,37 ****
- X
- X char *strdup();
- X
- X- #ifdef WHT
- X- #define ICMDH_MAXCNT 100
- X- #else
- X #define ICMDH_MAXCNT 50
- X- #endif
- X #define ICMDH_MAXLEN 72
- X
- X typedef struct icmd_hist
- X--- 27,33 ----
- X*** /export/home/wht/src/ecu314/eculine.c Wed Sep 4 00:25:05 1991
- X--- eculine.c Tue Sep 3 19:56:56 1991
- X***************
- X*** 36,41 ****
- X--- 36,43 ----
- X
- X ------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X+ /*:09-01-1991-14:18-wht@n4hgf2-on sun, use termios and improve ldraino */
- X+ /*:09-01-1991-02:51-wht@n4hgf2-sun CRTSCTS turn on bug fixed */
- X /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
- X /*:08-11-1991-18:06-wht@n4hgf-SCO_TTY_NAMING considerations */
- X /*:08-06-1991-14:18-wht@n4hgf-baud rates below 300 get two stop bits */
- X***************
- X*** 62,68 ****
- X # include <sys/termiox.h>
- X int hx_flag;
- X #endif
- X- extern int sigint; /* SIGINT flag: see xmtr_SIGINT_handler */
- X
- X int lgetc_count;
- X
- X--- 64,69 ----
- X***************
- X*** 198,204 ****
- X int delim_len;
- X long quantum;
- X long ltmp;
- X- long Nap();
- X
- X delim_len = (lrwt->delim) ? strlen(lrwt->delim) : 0;
- X
- X--- 199,204 ----
- X***************
- X*** 416,422 ****
- X {
- X uchar rtn_char;
- X #if defined(NO_SELECT)
- X- long Nap();
- X long timeout;
- X
- X AGAIN:
- X--- 416,421 ----
- X***************
- X*** 568,574 ****
- X--- 567,591 ----
- X ldraino(inflush_flag)
- X int inflush_flag;
- X {
- X+ #if defined(sun)
- X+ int retries = 50;
- X+ int outq_count;
- X+ int old_outq_count = 0;
- X+
- X+ do {
- X+ ioctl(shm->Liofd,TIOCOUTQ,&outq_count);
- X+ if(!outq_count)
- X+ break;
- X+ if(old_outq_count == outq_count) /* don't hang if flow control lock */
- X+ retries--;
- X+ old_outq_count = outq_count;
- X+ Nap(50);
- X+ } while(outq_count && retries);
- X+ if(inflush_flag)
- X+ ioctl(shm->Liofd,TCFLSH,TCIFLUSH);
- X+ #else
- X ioctl(shm->Liofd,(inflush_flag) ? TCSETAF : TCSETAW,(char *)&Ltermio);
- X+ #endif
- X
- X } /* end of ldraino */
- X
- X***************
- X*** 664,669 ****
- X--- 681,689 ----
- X {
- X int baud_selector = valid_baud_rate(shm->Lbaud);
- X
- X+ if(shm->Liofd < 0)
- X+ return(0);
- X+
- X if(baud_selector == -1)
- X baud_selector = valid_baud_rate(shm->Lbaud = DEFAULT_BAUD_RATE);
- X
- X***************
- X*** 721,727 ****
- X ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
- X ioctl(shm->Liofd, TCSETX, &flowctrl);
- X hx_flag = flowctrl.x_hflag;
- X! #else !SVR4
- X #if defined(RTSFLOW) /* only SCO */
- X switch(flag)
- X {
- X--- 741,747 ----
- X ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
- X ioctl(shm->Liofd, TCSETX, &flowctrl);
- X hx_flag = flowctrl.x_hflag;
- X! #else /* !SVR4 */
- X #if defined(RTSFLOW) /* only SCO */
- X switch(flag)
- X {
- X***************
- X*** 761,767 ****
- X
- X default:
- X Ltermio.c_iflag &= ~(IXON | IXOFF | IXANY);
- X! Ltermio.c_cflag |= ~(CRTSCTS);
- X break;
- X
- X }
- X--- 781,787 ----
- X
- X default:
- X Ltermio.c_iflag &= ~(IXON | IXOFF | IXANY);
- X! Ltermio.c_cflag |= CRTSCTS;
- X break;
- X
- X }
- X***************
- X*** 799,804 ****
- X--- 819,827 ----
- X lset_parity(ioctl_flag)
- X int ioctl_flag;
- X {
- X+ if(shm->Liofd < 0)
- X+ return;
- X+
- X Ltermio.c_cflag &= ~(CS8 | PARENB | PARODD);
- X switch(to_lower(shm->Lparity))
- X {
- X***************
- X*** 857,867 ****
- X int
- X lopen()
- X {
- X! int itmp;
- X! struct stat ttystat;
- X
- X- lopen_err_str[0] = 0;
- X-
- X /*
- X * system independent checks
- X */
- X--- 880,888 ----
- X int
- X lopen()
- X {
- X! int itmp;
- X! struct stat ttystat;
- X
- X /*
- X * system independent checks
- X */
- X***************
- X*** 875,894 ****
- X /*
- X * SCO system dependent checks
- X */
- X! #if defined(M_SYSV)
- X! if(strncmp(shm->Lline,"/dev/tty",8))
- X! return(LOPEN_INVALID);
- X #endif /* M_SYSV */
- X
- X /*
- X * ISC system dependent checks
- X */
- X! #if defined(ISC)
- X if(strncmp(shm->Lline,"/dev/tty",8) && strncmp(shm->Lline,"/dev/acu",8))
- X return(LOPEN_INVALID);
- X #endif
- X
- X /*
- X * lock the tty
- X */
- X if(itmp = lock_tty()) /* get lock file */
- X--- 896,928 ----
- X /*
- X * SCO system dependent checks
- X */
- X! #if defined(M_SYSV) /* && defined(SCO_TTY_NAMING) */
- X! /* device, lock file needs lower-case device name */
- X! itmp = strlen(shm->Lline) - 1;
- X! shm->Lline[itmp] = to_lower(shm->Lline[itmp]);
- X #endif /* M_SYSV */
- X
- X /*
- X * ISC system dependent checks
- X */
- X! #if 0
- X! #if defined(ISC)
- X if(strncmp(shm->Lline,"/dev/tty",8) && strncmp(shm->Lline,"/dev/acu",8))
- X return(LOPEN_INVALID);
- X #endif
- X+ #endif
- X
- X /*
- X+ * Sun system dependent checks
- X+ */
- X+ #if 0
- X+ #if defined(sun)
- X+ if(strncmp(shm->Lline,"/dev/tty",8) && strncmp(shm->Lline,"/dev/cua",8))
- X+ return(LOPEN_INVALID);
- X+ #endif
- X+ #endif
- X+
- X+ /*
- X * lock the tty
- X */
- X if(itmp = lock_tty()) /* get lock file */
- X***************
- X*** 895,901 ****
- X return(itmp);
- X
- X /*
- X! * lock the tty
- X */
- X if((shm->Liofd = open(shm->Lline,O_RDWR | O_NDELAY,0777)) < 0)
- X {
- X--- 929,935 ----
- X return(itmp);
- X
- X /*
- X! * open the tty using non-blocking I/O to bypass DCD wait
- X */
- X if((shm->Liofd = open(shm->Lline,O_RDWR | O_NDELAY,0777)) < 0)
- X {
- X***************
- X*** 909,915 ****
- X
- X
- X /*
- X! * turn off non-blocking I/O
- X */
- X fcntl(shm->Liofd,F_GETFL,&itmp);
- X itmp &= ~O_NDELAY;
- X--- 943,949 ----
- X
- X
- X /*
- X! * turn off non-blocking I/O and set initial termio, including CLOCAL
- X */
- X fcntl(shm->Liofd,F_GETFL,&itmp);
- X itmp &= ~O_NDELAY;
- X***************
- X*** 925,934 ****
- X lset_baud_rate(0); /* do not perform ioctl */
- X lset_parity(1); /* do perform ioctl */
- X
- X- lopen_err_str[0] = 0;
- X #ifdef SVR4
- X! hx_flag = 0;
- X #endif
- X return(0);
- X
- X } /* end of lopen */
- X--- 959,969 ----
- X lset_baud_rate(0); /* do not perform ioctl */
- X lset_parity(1); /* do perform ioctl */
- X
- X #ifdef SVR4
- X! hx_flag = 0; /* hardware flow control "memory" */
- X #endif
- X+
- X+ lopen_err_str[0] = 0; /* no error this time! */
- X return(0);
- X
- X } /* end of lopen */
- X*** /export/home/wht/src/ecu314/ecunumrev.c Wed Sep 4 00:25:05 1991
- X--- ecunumrev.c Tue Sep 3 19:35:29 1991
- X***************
- X*** 3,9 ****
- X wht@n4hgf.Mt-Park.GA.US
- X ------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */
- X /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
- X /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
- X /*:07-12-1991-14:14-wht@n4hgf-GCC140 differentiation */
- X--- 3,9 ----
- X wht@n4hgf.Mt-Park.GA.US
- X ------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
- X /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
- X /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
- X /*:07-12-1991-14:14-wht@n4hgf-GCC140 differentiation */
- X***************
- X*** 24,32 ****
- X #endif
- X
- X #ifdef WHT
- X! char *numeric_revision = "x3.64";
- X #else
- X! char *numeric_revision = "3";
- X #endif
- X char *revstr = "";
- X
- X--- 24,32 ----
- X #endif
- X
- X #ifdef WHT
- X! char *numeric_revision = "x3.73";
- X #else
- X! char *numeric_revision = "x3";
- X #endif
- X char *revstr = "";
- X
- X***************
- X*** 70,78 ****
- X
- X #if defined(__GNUC__)
- X #if defined(GCC140)
- X! strcat(s128,"G");
- X #else
- X! strcat(s128,"g");
- X #endif
- X #if defined(__STDC__)
- X strcat(s128,"A");
- X--- 70,78 ----
- X
- X #if defined(__GNUC__)
- X #if defined(GCC140)
- X! strcat(s128,"-G");
- X #else
- X! strcat(s128,"-g");
- X #endif
- X #if defined(__STDC__)
- X strcat(s128,"A");
- X*** /export/home/wht/src/ecu314/ecuphone.c Wed Sep 4 00:25:06 1991
- X--- ecuphone.c Tue Sep 3 18:59:00 1991
- X***************
- X*** 140,146 ****
- X extern int errno;
- X
- X extern int windows_active;
- X- extern int sigint;
- X extern int rcvr_pid;
- X extern char errmsg[];
- X extern char kbdintr;
- X--- 140,145 ----
- X*** /export/home/wht/src/ecu314/ecuphrase.c Wed Sep 4 00:24:42 1991
- X--- ecuphrase.c Tue Sep 3 18:59:16 1991
- X***************
- X*** 120,126 ****
- X extern char *phrases_string[];
- X extern int phrases_count;
- X extern int phrases_resident;
- X- extern int sigint;
- X extern int icmd_prompt_len;
- X
- X for(itmp = icmd_prompt_len + strlen(nargv[0]); itmp; itmp--)
- X--- 120,125 ----
- X*** /export/home/wht/src/ecu314/ecusetup.c Wed Sep 4 00:25:06 1991
- X--- ecusetup.c Tue Sep 3 19:42:45 1991
- X***************
- X*** 10,16 ****
- X 03| Telephone .................... |
- X 04| Description ........................................ |
- X 05| |
- X! 06| tty: /dev/tty..... (opened) |
- X 07| |
- X 08| duplex: . baud: ..... parity: . (data bits .) |
- X 09| add NL to transmitted CR: . |
- X--- 10,16 ----
- X 03| Telephone .................... |
- X 04| Description ........................................ |
- X 05| |
- X! 06| tty: /dev/........ (opened) |
- X 07| |
- X 08| duplex: . baud: ..... parity: . (data bits .) |
- X 09| add NL to transmitted CR: . |
- X***************
- X*** 34,40 ****
- X
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */
- X /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
- X /*:08-12-1991-00:58-wht@n4hgf-ISC tty names */
- X /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
- X--- 34,40 ----
- X
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X! /*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
- X /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
- X /*:08-12-1991-00:58-wht@n4hgf-ISC tty names */
- X /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
- X***************
- X*** 109,116 ****
- X #define RADDNL_LX 3
- X
- X extern char *revstr; /* ecunumrev.c */
- X- extern int rcvr_pid;
- X- extern int sigint;
- X extern char errmsg[];
- X
- X WINDOW *setw;
- X--- 109,114 ----
- X***************
- X*** 242,250 ****
- X
- X /*+-------------------------------------------------------------------------
- X setup_display_tty()
- X! 000000000011111
- X! 012345678901234
- X! /dev/ttyxxxxxx
- X --------------------------------------------------------------------------*/
- X void
- X setup_display_tty()
- X--- 240,248 ----
- X
- X /*+-------------------------------------------------------------------------
- X setup_display_tty()
- X! 00000000
- X! 01234567
- X! /dev/........
- X --------------------------------------------------------------------------*/
- X void
- X setup_display_tty()
- X***************
- X*** 307,313 ****
- X wmove(setw,DESCR_Y,DESCR_LX);
- X waddstr(setw,"Description");
- X wmove(setw,TTY_Y,TTY_LX);
- X! waddstr(setw,"tty: /dev/tty");
- X wmove(setw,DPX_Y,DPX_LX);
- X waddstr(setw,"duplex:");
- X wmove(setw,BAUD_Y,BAUD_LX);
- X--- 305,311 ----
- X wmove(setw,DESCR_Y,DESCR_LX);
- X waddstr(setw,"Description");
- X wmove(setw,TTY_Y,TTY_LX);
- X! waddstr(setw,"tty: /dev/");
- X wmove(setw,DPX_Y,DPX_LX);
- X waddstr(setw,"duplex:");
- X wmove(setw,BAUD_Y,BAUD_LX);
- X*** /export/home/wht/src/ecu314/ecusighdl.c Wed Sep 4 00:24:55 1991
- X--- ecusighdl.c Sun Sep 1 18:39:00 1991
- X***************
- X*** 205,210 ****
- X--- 205,211 ----
- X case TERMECU_INIT_PROC_ERROR: return("error during initial procedure");
- X case TERMECU_CONFIG_ERROR: return("configuration error");
- X case TERMECU_CURSES_ERROR: return("error in curses use");
- X+ case TERMECU_MALLOC: return("critical memory allocation failure");
- X default:
- X sprintf(errant,"code %u?",code);
- X return(errant);
- X***************
- X*** 285,291 ****
- X }
- X }
- X restore_initial_colors();
- X! #ifdef WHT
- X xterm_title("xterm",0);
- X #endif
- X }
- X--- 286,292 ----
- X }
- X }
- X restore_initial_colors();
- X! #if defined(WHT) || defined(XTERM_FRIEND)
- X xterm_title("xterm",0);
- X #endif
- X }
- X*** /export/home/wht/src/ecu314/ecutty.c Wed Sep 4 00:24:55 1991
- X--- ecutty.c Tue Sep 3 19:02:13 1991
- X***************
- X*** 42,49 ****
- X--- 42,73 ----
- X brown 6 yellow 14
- X white 7 hi_white 15
- X
- X+ With Lothar's ISC SVR4, the format is
- X+
- X+ 00000000001111111111222222222233
- X+ 01234567890123456789012345678901
- X+ 00000000000000000011????0100????
- X+ 0 0 0 0 3 f 4 o b
- X+ where f is the foreground color
- X+ and b is the background color
- X+
- X+ (I dont have one, so I'm guessing these colors are chosen from
- X+ the ISO colors:
- X+
- X+ BLACK 0
- X+ RED 1
- X+ GREEN 2
- X+ YELLOW 3
- X+ BLUE 4
- X+ MAGENTA 5
- X+ CYAN 6
- X+ WHITE 7
- X+
- X --------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X+ /*:08-31-1991-13:29-wht@n4hgf2-look for colors in ECULIBDIR too */
- X+ /*:08-30-1991-04:12-wht@n4hgf2-restore colors wrong to do now if not SCO */
- X+ /*:08-30-1991-02:49-aega84!lh-use at_ansi.h/kd.h/CONS_GET under ISC SVR4 */
- X /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
- X /*:08-17-1991-18:29-wht@n4hgf-add kbdtest command */
- X /*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
- X***************
- X*** 64,73 ****
- X #include "ecuxkey.h"
- X #include "ecuerror.h"
- X #include "termecu.h"
- X #if defined(M_SYSV)
- X # include <sys/machdep.h>
- X #else
- X! #if defined(ISC)
- X # include <sys/at_ansi.h>
- X # include <sys/kd.h>
- X #endif /* ISC */
- X--- 88,104 ----
- X #include "ecuxkey.h"
- X #include "ecuerror.h"
- X #include "termecu.h"
- X+
- X+ /*
- X+ * This is how we determine whether we are on a color terminal or not.
- X+ * We handle SCO XENIX, UNIX , ISC 2.2 aqnd ISC SVR4.
- X+ * If you have trouble with this add some kind of thing instead of MYSYS
- X+ * and mail me the full details. Search for MYSYS throughout here.
- X+ */
- X #if defined(M_SYSV)
- X # include <sys/machdep.h>
- X #else
- X! #if defined(ISC) || defined(SVR4) /* && !defined(MYSYS) */
- X # include <sys/at_ansi.h>
- X # include <sys/kd.h>
- X #endif /* ISC */
- X***************
- X*** 109,115 ****
- X XFhome /* KDEk_HOME */
- X };
- X
- X- extern int sigint;
- X extern int hz;
- X extern uint tcap_LINES;
- X extern uint tcap_COLS;
- X--- 140,145 ----
- X***************
- X*** 154,160 ****
- X uchar *dole_out_tgc_accum = (uchar *)0;
- X int dole_out_tgc_accum_count = 0;
- X
- X! #ifdef SVR4
- X ulong colors_current = 0x00003740;
- X ulong colors_normal = 0x00003740; /* */
- X ulong colors_initial = 0x00003740; /* */
- X--- 184,199 ----
- X uchar *dole_out_tgc_accum = (uchar *)0;
- X int dole_out_tgc_accum_count = 0;
- X
- X! /*
- X! * color definitions per format described at top of source
- X! * we handle SCO XENIX and UNIX and ISC SVR4 but not "MYSYS"
- X! * (search for MYSYS near top of source for clue what MYSYS means)
- X! *
- X! * As of this writing, I don't know about colors on ISC 2.2.
- X! * but they might be the same as for SVR4.
- X! *
- X! */
- X! #if defined(SVR4)
- X ulong colors_current = 0x00003740;
- X ulong colors_normal = 0x00003740; /* */
- X ulong colors_initial = 0x00003740; /* */
- X***************
- X*** 162,168 ****
- X ulong colors_alert = 0x00003740L; /* */
- X ulong colors_error = 0x00003140L; /* */
- X ulong colors_notify = 0x00003340L; /* */
- X! #else
- X ulong colors_current = 0x04070A00L;
- X ulong colors_normal = 0x04070A00L; /* default lt_green/black red/white */
- X ulong colors_initial = 0x04070A00L; /* default initial colors */
- X--- 201,207 ----
- X ulong colors_alert = 0x00003740L; /* */
- X ulong colors_error = 0x00003140L; /* */
- X ulong colors_notify = 0x00003340L; /* */
- X! #else /* SCO XENIX and UNIX ---- other? */
- X ulong colors_current = 0x04070A00L;
- X ulong colors_normal = 0x04070A00L; /* default lt_green/black red/white */
- X ulong colors_initial = 0x04070A00L; /* default initial colors */
- X***************
- X*** 245,251 ****
- X--- 284,292 ----
- X _setcolor(clrs)
- X ulong clrs;
- X {
- X+ #ifdef SVR4
- X char fg[4], bg[4];
- X+ #endif
- X
- X if(!use_colors || tty_not_char_special)
- X return;
- X***************
- X*** 256,262 ****
- X sprintf(bg,"%s", clrs & 0xFF);
- X ff(se,"\033[%sm", fg);
- X ff(se,"\033[%sm", bg);
- X! #else
- X /* normal */
- X ff(se,"\033[=%ldF\033[=%ldG",(clrs >> 8) & 0xFF,clrs & 0xFF);
- X
- X--- 297,303 ----
- X sprintf(bg,"%s", clrs & 0xFF);
- X ff(se,"\033[%sm", fg);
- X ff(se,"\033[%sm", bg);
- X! #else /* SCO */
- X /* normal */
- X ff(se,"\033[=%ldF\033[=%ldG",(clrs >> 8) & 0xFF,clrs & 0xFF);
- X
- X***************
- X*** 352,362 ****
- X void
- X restore_initial_colors()
- X {
- X! #ifdef M_UNIX
- X! setcolor(colors_initial);
- X! #else
- X! setcolor(colors_normal);
- X #endif
- X } /* end of restore_initial_colors */
- X
- X /*+-------------------------------------------------------------------------
- X--- 393,408 ----
- X void
- X restore_initial_colors()
- X {
- X! #if defined(M_UNIX) || defined(SVR4)
- X! if(use_colors)
- X! setcolor(colors_initial);
- X! else
- X #endif
- X+ {
- X+ tcap_blink_off();
- X+ tcap_bold_off();
- X+ tcap_underscore_off();
- X+ }
- X } /* end of restore_initial_colors */
- X
- X /*+-------------------------------------------------------------------------
- X***************
- X*** 429,435 ****
- X get_home_dir(s128);
- X strcat(s128,"/.ecu/colors");
- X if(access(s128,4))
- X! return;
- X
- X fp = fopen(s128,"r");
- X
- X--- 475,486 ----
- X get_home_dir(s128);
- X strcat(s128,"/.ecu/colors");
- X if(access(s128,4))
- X! {
- X! get_home_dir(eculibdir);
- X! strcat(s128,"/colors");
- X! if(access(s128,4))
- X! return;
- X! }
- X
- X fp = fopen(s128,"r");
- X
- X***************
- X*** 505,511 ****
- X--- 556,564 ----
- X uchar param;
- X {
- X int itmp;
- X+ #if defined(M_SYSV) || defined(ISC) || defined(SVR4) /* && !defined(MYSYS) */
- X int monitor_type;
- X+ #endif
- X char *cptr;
- X int fddevtty = open("/dev/tty",O_RDONLY,0);
- X
- X***************
- X*** 573,579 ****
- X * (I ain't proud of this beyond being a valiant attempt)
- X */
- X use_colors = 0;
- X! #if defined(M_SYSV) || defined(ISC)
- X if( ((itmp = ioctl(TTYIN,CONS_GET,&monitor_type)) >= 0) &&
- X (use_colors = (monitor_type != MONO)))
- X {
- X--- 626,632 ----
- X * (I ain't proud of this beyond being a valiant attempt)
- X */
- X use_colors = 0;
- X! #if defined(M_SYSV) || defined(ISC) || defined(SVR4) /* && !defined(MYSYS) */
- X if( ((itmp = ioctl(TTYIN,CONS_GET,&monitor_type)) >= 0) &&
- X (use_colors = (monitor_type != MONO)))
- X {
- X*** /export/home/wht/src/ecu314/ecuutil.c Wed Sep 4 00:24:56 1991
- X--- ecuutil.c Tue Sep 3 22:37:30 1991
- X***************
- X*** 31,38 ****
- X--- 31,48 ----
- X strip_trail_break(zstr)
- X yes_or_no(strarg)
- X
- X+
- X+ This module assumes the neo-standard 'mode_t' type is an unsigned
- X+ short and 'dev_t' is a short in accordance with tradition. This
- X+ is, in fact, true with all the supported systems which have it as
- X+ of this writing. This is just a test of the Brown Shirt Warning
- X+ System. If this had been an actual Brown Shirt Alert, you would
- X+ have heard the noise of sickening thuds and breaking things nearby.
- X+
- X ------------------------------------------------------------------------*/
- X /*+:EDITS:*/
- X+ /*:09-01-1991-12:46-wht@n4hgf2-show sun flow control bit */
- X+ /*:08-30-1991-20:09-wht@n4hgf2-sun Nap was not returning a value */
- X /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
- X /*:08-17-1991-14:11-root@n4hgf-ascii_to_hex supports "csi" */
- X /*:08-13-1991-13:53-wht@n4hgf-UNIX and ISC nap() broken; XENIX still wins */
- X***************
- X*** 104,110 ****
- X #if defined(M_UNIX) && !defined(DUFF) /* && !defined(__GNUC__) */
- X /*
- X * memmove() clobbers regs that GCC wants to keep
- X! * unless you use at least some of -fcall-save-{ax,bx,cx,dx}
- X */
- X memmove(dest,src,len);
- X #else
- X--- 114,120 ----
- X #if defined(M_UNIX) && !defined(DUFF) /* && !defined(__GNUC__) */
- X /*
- X * memmove() clobbers regs that GCC wants to keep
- X! * unless you use -fcall-save-bx
- X */
- X memmove(dest,src,len);
- X #else
- X***************
- X*** 277,283 ****
- X--- 287,296 ----
- X return((char *)0);
- X
- X if(parsestr)
- X+ {
- X+ str_token_static = (char *)0;
- X parseptr = parsestr;
- X+ }
- X else
- X parseptr = str_token_static;
- X
- X***************
- X*** 384,390 ****
- X--- 397,406 ----
- X return((char *)0);
- X
- X if(parsestr)
- X+ {
- X+ str_token_static = (char *)0;
- X parseptr = parsestr;
- X+ }
- X else
- X parseptr = str_token_static;
- X
- X***************
- X*** 659,671 ****
- X (flag & CLOCAL) ? 1 : 0);
- X #if defined(RTSFLOW) || defined(SVR4) /* only SCO and SVR4 */
- X pprintf(" RTSFLOW:%d CTSFLOW:%d",
- X #ifdef SVR4
- X (hx_flag & RTSXOFF ) ? 1 : 0,
- X (hx_flag & CTSXON ) ? 1 : 0);
- X- #else
- X- (flag & RTSFLOW ) ? 1 : 0,
- X- (flag & CTSFLOW ) ? 1 : 0);
- X #endif
- X #endif
- X pprintf("\n");
- X
- X--- 675,690 ----
- X (flag & CLOCAL) ? 1 : 0);
- X #if defined(RTSFLOW) || defined(SVR4) /* only SCO and SVR4 */
- X pprintf(" RTSFLOW:%d CTSFLOW:%d",
- X+ (flag & RTSFLOW ) ? 1 : 0,
- X+ (flag & CTSFLOW ) ? 1 : 0);
- X+ #endif
- X #ifdef SVR4
- X+ pprintf(" RTSXOFF:%d CTSXON:%d",
- X (hx_flag & RTSXOFF ) ? 1 : 0,
- X (hx_flag & CTSXON ) ? 1 : 0);
- X #endif
- X+ #ifdef CRTSCTS
- X+ pprintf(" CRTSCTS:%d",(flag & CRTSCTS ) ? 1 : 0);
- X #endif
- X pprintf("\n");
- X
- X***************
- X*** 1074,1098 ****
- X As it is nap() is nearly useless. I believe select() suffers
- X from the same deficiency (< 1000 msec timeout becomes 1000 msec) but
- X I haven't "proven" it yet.
- X --------------------------------------------------------------------------*/
- X long
- X Nap(msec)
- X long msec;
- X {
- X! #if defined(sun)
- X struct timeval timer;
- X! timer.tv_sec = 0;
- X! timer.tv_usec = 1000L * msec;
- X! select(0,0,0,0,&timer);
- X #else
- X #if defined(M_XENIX) || defined(WORKING_UNIX_NAP)
- X return(nap(msec));
- X #else
- X if(msec < hzmsec)
- X msec = hzmsec;
- X if(nap(msec) < 0)
- X return(-1);
- X return(msec);
- X #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */
- X #endif /* sun */
- X
- X--- 1093,1157 ----
- X As it is nap() is nearly useless. I believe select() suffers
- X from the same deficiency (< 1000 msec timeout becomes 1000 msec) but
- X I haven't "proven" it yet.
- X+
- X+ On systems with a working select(), we use a relatively complex select
- X+ arrangement to accomplish the nap requirement, but with an improvement.
- X+ The "nap" survives any EINTR except for SIGINT (as indicated by sigint
- X+ getting set). On SIGINT, the nap is aborted.
- X+
- X+ A "working select" means
- X+ 1. the system tries to support it (all but XENIX 286)
- X+ 2. it is in libc.a (all but XENIX; see xsel386/* to fix XENIX 386)
- X+ 3. it is not broken (XENIX 386 select fails on ttys, but can be
- X+ fixed: see xsel386/*; even an "unfixed" XENIX select would work
- X+ here because we are only interested in timeouts)
- X+ 4. it times out properly (SCO UNIX 3.2.[1-2] screws up by ROUNDING
- X+ timeouts UP to ONE SECOND).
- X --------------------------------------------------------------------------*/
- X long
- X Nap(msec)
- X long msec;
- X {
- X! #if defined(WORKING_SELECT)
- X! /*
- X! * Compute A -= B for timeval structs A, B (thanks to ping.c)
- X! */
- X! #define tvsub(A, B) \
- X! (A)->tv_sec -= (B)->tv_sec ;\
- X! if (((A)->tv_usec -= (B)->tv_usec) < 0)\
- X! { (A)->tv_sec--; (A)->tv_usec += 1000000; }
- X!
- X struct timeval timer;
- X! struct timeval start;
- X! struct timeval now;
- X! struct timezone trash;
- X!
- X! gettimeofday(&start,&trash);
- X! timer.tv_sec = msec / 1000;
- X! timer.tv_usec = (msec % 1000L) * 1000L;
- X! while( ((timer.tv_sec * 1000000 + timer.tv_usec) > 0) &&
- X! (select(32,0,0,0,&timer) < 0) && (errno == EINTR))
- X! {
- X! if(sigint) /* if SIGINT posted, exit now */
- X! return(-1);
- X! gettimeofday(&now,&trash);
- X! tvsub(&now,&start);
- X! tvsub(&timer,&now);
- X! }
- X! return(msec);
- X #else
- X #if defined(M_XENIX) || defined(WORKING_UNIX_NAP)
- X return(nap(msec));
- X #else
- X+ #if defined(M_UNIX) || defined(ISC)
- X if(msec < hzmsec)
- X msec = hzmsec;
- X if(nap(msec) < 0)
- X return(-1);
- X return(msec);
- X+ #else
- X+ # include "porting.attention.needed.here"
- X+ #endif /* use hacked nap */
- X #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */
- X #endif /* sun */
- X
- X***************
- X*** 1101,1109 ****
- X /*+-------------------------------------------------------------------------
- X rdchk(fd) - for systems without it but with FIONREAD
- X --------------------------------------------------------------------------*/
- X! #if defined(sun)
- X int
- X rdchk(fd)
- X {
- X int chars_waiting;
- X
- X--- 1160,1169 ----
- X /*+-------------------------------------------------------------------------
- X rdchk(fd) - for systems without it but with FIONREAD
- X --------------------------------------------------------------------------*/
- X! #if defined(BSD)
- X int
- X rdchk(fd)
- X+ int fd;
- X {
- X int chars_waiting;
- X
- X*** /export/home/wht/src/ecu314/ecuwinutil.c Wed Sep 4 00:24:56 1991
- X--- ecuwinutil.c Sun Sep 1 18:39:26 1991
- X***************
- X*** 41,49 ****
- X #define ulong unsigned long
- SHAR_EOF
- true || echo 'restore of PATCH5.01 failed'
- fi
- echo 'End of ecu/patch05 part 2'
- echo 'File PATCH5.01 is continued in part 3'
- echo 3 > _shar_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
-